package com.example.mapper;

import com.example.entity.College;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CollegeMapper {
    void insert(College college);

    @Select("SELECT * FROM college WHERE  name LIKE CONCAT('%',#{name},'%')")
    List<College> selectByName(String name);

    @Select("SELECT * FROM college")
    List<College> selectAll();

    @Update("UPDATE college SET `name`=#{name},content=#{content},score=#{score} WHERE id=#{id}")
    void updateById(College college);

    @Delete("DELETE FROM college WHERE id=#{id}")
    void deleteById(Integer id);
}
